﻿function CheckPass(str)
{
	if(str.length==0)
	{
		document.getElementById("passCheck").innerHTML="";
		return;
	}
	if(str.length<6 || str.length>18)
	{
		document.getElementById("passCheck").style.color="red";
		document.getElementById("passCheck").innerHTML="×";
		return;
	}
	document.getElementById("passCheck").style.color="green";
	document.getElementById("passCheck").innerHTML="√";
}
function CheckEnsurePass(str)
{
	var str1=document.getElementById("password").value;
	if(str.length==0)
	{
		document.getElementById("ensurePassCheck").innerHTML="";
		return;
	}
	if(str1==str)
	{
	    document.getElementById("ensurePassCheck").style.color="green";
		document.getElementById("ensurePassCheck").innerHTML="√";
		return;
	}
	document.getElementById("ensurePassCheck").style.color="red";
	document.getElementById("ensurePassCheck").innerHTML="×";
}
function CheckEmail(str)
{
	var myreg = /^([a-zA-Z0-9]+[_.]?)*[a-zA-Z0-9]+@([a-zA-Z0-9]+[_|\_|\.]?)*[a-zA-Z0-9]+\.[a-zA-Z]{2,3}$/;
	if(str.length==0)
	{
		document.getElementById("emailCheck").innerHTML="";
		return ;
	}
	if(!myreg.test(str))
	{
	    document.getElementById("emailCheck").style.color="red";
		document.getElementById("emailCheck").innerHTML="×";
		return;
	}
	document.getElementById("emailCheck").style.color="green";
	document.getElementById("emailCheck").innerHTML="√";
	
}
function CheckStuNum(str)
{
	if(str.length==0)
	{
		document.getElementById("stuNumCheck").innerHTML="";
		return ;
	}
	if(str.length!=8)
	{
	    document.getElementById("stuNumCheck").style.color="red";
		document.getElementById("stuNumCheck").innerHTML="×";
		return;
	}
	document.getElementById("stuNumCheck").style.color="green";
	document.getElementById("stuNumCheck").innerHTML="√";
	
}
function verifyAll()
{
	if(document.getElementById("accCheck").innerHTML=="√"
	    &&document.getElementById("passCheck").innerHTML=="√"
		&&document.getElementById("ensurePassCheck").innerHTML=="√"
		&&document.getElementById("emailCheck").innerHTML=="√"
		&&document.getElementById("stuNumCheck").innerHTML=="√")
		return true;
	else
	{
		alert('信息填写不完整或有误');
		return false;
	}
}